package ai.tubes.iris;

import android.app.Activity;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class SolveMenuActivity extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.solve);
		
		mCamera	= (Button)findViewById(R.id.camera_button);
		mCamera.setOnClickListener(new View.OnClickListener() {
			public void onClick(View arg0) {
				startActivityForResult(new Intent(SolveMenuActivity.this.getApplicationContext(), SolveFromCameraActivity.class), SolveFromCameraActivity.REQUEST_CODE);
			}
		});
		
		mForm	= (Button)findViewById(R.id.form_button);
		mForm.setOnClickListener(new View.OnClickListener() {
			public void onClick(View arg0) {
				startActivityForResult(new Intent(SolveMenuActivity.this.getApplicationContext(), SolveFromFormActivity.class), SolveFromFormActivity.REQUEST_CODE);
			}
		});
	}
	
	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		if (resultCode != RESULT_OK) return;
		
		switch (requestCode) {
		case SolveFromCameraActivity.REQUEST_CODE :
			Intent intent = new Intent(getApplicationContext(), CameraSolutionActivity.class);
			//intent.putExtra("image", data.getExtras().getByteArray("image"));
			startActivity(intent);
			break;
			
		case SolveFromFormActivity.REQUEST_CODE :
			
			break;
		}
	}
	
	private Button mCamera, mForm;
}
